﻿using System;
using System.Runtime.Serialization;
using System.Windows.Media.Media3D;
namespace GameBoard
{
    [DataContract]
    public class MapVisualFactory : BaseVisualFactory
    {
        public MapVisualFactory(MapVisualData d)
            : base(d)
        {
        }

        public override ModelVisual3D MakeVisual()
        {
            var curData = VisualData as MapVisualData;
            MapVisual.EvaluateHeight = curData.CurrentBoardInfo.DefinedBoardHeight;
            MapVisual.EvaluateWidth = curData.CurrentBoardInfo.DefinedBoardWidth;
            MapVisual.HillValue = curData.CurrentBoardInfo.BoardHillValue;
            SimplexNoise.Perm = curData.CurrentBoardInfo.NoisePermutations;
            
            var d = new MapVisual();
            d.PopulateVisualData(VisualData);
            return d.VisualElement;
        }
    }
}